package com.fas.app;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class GuidPageView extends LinearLayout {
	private TextView leftV, rightV;

	private LinearLayout middle_view;

	public GuidPageView(Context context) {
		super(context);
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View view = inflater.inflate(R.layout.guiditem1, this, true);

		leftV = (TextView) findViewById(R.id.left);
		rightV = (TextView) findViewById(R.id.right);

		middle_view = (LinearLayout) findViewById(R.id.middleview);
		
	}

	public LinearLayout getMiddle_view() {
		return middle_view;
	}

	public void addView(View view) {
		if (view == null) {
			return;
		}
		middle_view.addView(view);
	}

	public GuidPageView(Context context, AttributeSet attrs) {
		super(context, attrs);

		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View view = inflater.inflate(R.layout.guiditem1, this, true);

		leftV = (TextView) view.findViewById(R.id.left);
		rightV = (TextView) view.findViewById(R.id.right);

		middle_view = (LinearLayout) findViewById(R.id.middleview);

	}

	public void setLeftInvisible(int value) {
		if (View.INVISIBLE == value) {
			leftV.setVisibility(View.INVISIBLE);
		} else if (View.GONE == value) {
			leftV.setVisibility(View.GONE);
		} else {
			leftV.setVisibility(View.VISIBLE);
		}
	}

	public void setRightInvisible(int value) {
		if (View.INVISIBLE == value) {
			rightV.setVisibility(View.INVISIBLE);
		} else if (View.GONE == value) {
			rightV.setVisibility(View.GONE);
		} else {
			rightV.setVisibility(View.VISIBLE);
		}
	}

}
